"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const fs_1 = __importDefault(require("fs"));
const mes_1 = __importDefault(require("../utils/mes"));
class Shop {
}
Shop.getShopList = (req, res) => {
    try {
        const { offset, limit } = req.query;
        const shopList = JSON.parse(fs_1.default.readFileSync('./src/controller/shop.json', 'utf8'));
        res.send(mes_1.default.success('商品列表', shopList.slice(Number(offset !== null && offset !== void 0 ? offset : 0), Number(offset !== null && offset !== void 0 ? offset : 0) + Number(limit !== null && limit !== void 0 ? limit : 10))));
    }
    catch (error) {
        res.status(500).send(mes_1.default.failed(error));
    }
};
exports.default = Shop;
